<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"blog.liu-tm.cn","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="Http跨域请求及HttpSession同步终极手册 后端配置继承org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport或者实现javax.servlet.Filter接口两种方式，springboot2.0以上才有WebMvcConfigurationSupport，之前为WebMvcConfigu">
<meta property="og:type" content="article">
<meta property="og:title" content="Http Cross">
<meta property="og:url" content="https://blog.liu-tm.cn/2021/03/05/Http_Cross/index.html">
<meta property="og:site_name" content="Marvin&#39;s Blog">
<meta property="og:description" content="Http跨域请求及HttpSession同步终极手册 后端配置继承org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport或者实现javax.servlet.Filter接口两种方式，springboot2.0以上才有WebMvcConfigurationSupport，之前为WebMvcConfigu">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-03-05T02:30:10.000Z">
<meta property="article:modified_time" content="2021-03-05T03:32:22.615Z">
<meta property="article:author" content="Marvin">
<meta property="article:tag" content="develop">
<meta property="article:tag" content="java">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://blog.liu-tm.cn/2021/03/05/Http_Cross/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Http Cross | Marvin's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body  oncontextmenu=self.event.returnValue=false onselectstart="return false"
 itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Marvin's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Hi, My friend. Welcome to my space</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>


    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://blog.liu-tm.cn/2021/03/05/Http_Cross/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="Marvin">
      <meta itemprop="description" content="博闻天地">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Marvin's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Http Cross
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-03-05 10:30:10 / 修改时间：11:32:22" itemprop="dateCreated datePublished" datetime="2021-03-05T10:30:10+08:00">2021-03-05</time>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/03/05/Http_Cross/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/03/05/Http_Cross/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>3.3k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>Http跨域请求及HttpSession同步终极手册</p>
<h3 id="后端配置"><a href="#后端配置" class="headerlink" title="后端配置"></a>后端配置</h3><p>继承<code>org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport</code>或者实现<code>javax.servlet.Filter</code>接口两种方式，<code>springboot2.0</code>以上才有<code>WebMvcConfigurationSupport</code>，之前为<code>WebMvcConfigurerAdapter</code>。</p>
<p>实现<code>Filter</code>接口后跨域配置的核心代码如下，其中<code>HttpSession</code>同步的重点在于<code>response.setHeader(&quot;Access-Control-Allow-Credentials&quot;, &quot;true&quot;);</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">doFilter</span><span class="params">(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)</span></span></span><br><span class="line"><span class="function">            <span class="keyword">throws</span> IOException, ServletException </span>&#123;</span><br><span class="line"></span><br><span class="line">        HttpServletRequest request = (HttpServletRequest) servletRequest;</span><br><span class="line">        HttpServletResponse response = (HttpServletResponse) servletResponse;</span><br><span class="line"></span><br><span class="line">        String[] allowDomain = &#123;<span class="string">&quot;http://127.0.0.1:8848&quot;</span>, <span class="string">&quot;http://localhost:8848&quot;</span>&#125;;</span><br><span class="line">        Set&lt;String&gt; allowedOrigins = <span class="keyword">new</span> HashSet&lt;String&gt;(Arrays.asList(allowDomain));</span><br><span class="line">        log.info(<span class="string">&quot;&#123;&#125;&quot;</span>, request.getRequestURI());</span><br><span class="line">        String originHeader = request.getHeader(<span class="string">&quot;Origin&quot;</span>);</span><br><span class="line">        <span class="comment">// response.setHeader(&quot;Access-Control-Allow-Origin&quot;,request.getHeader(&quot;Origin&quot;));</span></span><br><span class="line">        <span class="comment">//注意重点:Access-Control-Allow-Origin不可以写*通配，需要明确写出请求方的IP地址及端口</span></span><br><span class="line">        <span class="keyword">if</span> (allowedOrigins.contains(originHeader)) &#123;</span><br><span class="line">            response.setHeader(<span class="string">&quot;Access-Control-Allow-Origin&quot;</span>, originHeader);</span><br><span class="line">            <span class="comment">//HttpSession同步重点，允许携带Cookie</span></span><br><span class="line">            response.setHeader(<span class="string">&quot;Access-Control-Allow-Credentials&quot;</span>, <span class="string">&quot;true&quot;</span>);</span><br><span class="line">            response.setHeader(<span class="string">&quot;Access-Control-Allow-Methods&quot;</span>, <span class="string">&quot;POST, GET, PATCH, DELETE, PUT&quot;</span>);</span><br><span class="line">            response.setHeader(<span class="string">&quot;Access-Control-Max-Age&quot;</span>, <span class="string">&quot;3600&quot;</span>);</span><br><span class="line">            response.setHeader(<span class="string">&quot;Access-Control-Allow-Headers&quot;</span>, <span class="string">&quot;Origin, X-Requested-With, Content-Type, Accept&quot;</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        filterChain.doFilter(servletRequest, servletResponse);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>继承<code>WebMvcConfigurationSupport</code>后，跨域配置应当重写<code>addCorsMappings</code>，同步<code>HttpSession</code>的重点在于<code>allowCredentials(true)</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">protected</span> <span class="keyword">void</span>  <span class="title">_addCorsMappings</span><span class="params">(CorsRegistry registry)</span> </span>&#123;</span><br><span class="line">	registry.addMapping(<span class="string">&quot;/**&quot;</span>) <span class="comment">// 允许跨域访问的路径</span></span><br><span class="line">                .allowedOrigins(<span class="string">&quot;&quot;</span>)<span class="comment">//允许跨域访问的源</span></span><br><span class="line">                .allowedMethods(<span class="string">&quot;&quot;</span>)<span class="comment">//允许请求方法</span></span><br><span class="line">                .allowedHeaders(<span class="string">&quot;&quot;</span>)<span class="comment">//允许头部设置</span></span><br><span class="line">                .allowCredentials(<span class="keyword">true</span>)<span class="comment">//允许请求携带Cookie</span></span><br><span class="line">                .maxAge(<span class="number">3600</span>);<span class="comment">//是否发送cookie，预检间隔时间</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>继承<code>WebMvcConfigurationSupport</code>后，同时可以配置拦截器，其中自定义拦截器<code>MyInterceptor</code>需要实现接口<code>HandlerInterceptor</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">addInterceptors</span><span class="params">(InterceptorRegistry registry)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// registry.addInterceptor(new TestInterceptor()).addPathPatterns(&quot;/**&quot;);  //  /**下的每一个接口都要有&quot;登录&quot;的校验</span></span><br><span class="line">    registry.addInterceptor(<span class="keyword">new</span> MyInterceptor()).addPathPatterns(<span class="string">&quot;/interceptor/test&quot;</span>);<span class="comment">//mes下的接口都要被拦截</span></span><br><span class="line">    <span class="keyword">super</span>.addInterceptors(registry);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="前端请求"><a href="#前端请求" class="headerlink" title="前端请求"></a>前端请求</h3><p>前端请求代码如下，根据前端框架配置可能有所不同，但是<code>HttpSession</code>同步的关键在于<code>xhrFields: &#123;withCredentials: true&#125;</code>，既为允许<code>Http</code>请求携带Cookie</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">$.ajax(&#123;</span><br><span class="line">    <span class="comment">// 同步请求是为让WebSocket连接之前可以从配置中拿到HttpSession</span></span><br><span class="line">    <span class="keyword">async</span>:<span class="literal">false</span>,</span><br><span class="line">    url: <span class="string">&#x27;http://192.168.1.10:9119/session/test&#x27;</span>,</span><br><span class="line">    data: &#123;</span><br><span class="line">        value: <span class="string">&#x27;admin&#x27;</span>,</span><br><span class="line">        key: <span class="string">&quot;123456&quot;</span>,</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="comment">// 下列两项配置为跨域请求HttpSession同步的关键，允许Http请求携带Cookie</span></span><br><span class="line">    xhrFields: &#123;</span><br><span class="line">        withCredentials: <span class="literal">true</span></span><br><span class="line">    &#125;,</span><br><span class="line">    crossDomain: <span class="literal">true</span>,</span><br><span class="line">    success: <span class="function"><span class="keyword">function</span>(<span class="params">data</span>) </span>&#123;</span><br><span class="line">        <span class="comment">// setCookie(data.name,data.value,data.time/1000);</span></span><br><span class="line">        <span class="built_in">console</span>.log(data)</span><br><span class="line">    &#125;</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
<h3 id="浏览器设置"><a href="#浏览器设置" class="headerlink" title="浏览器设置"></a>浏览器设置</h3><p><strong>重点：</strong>以上配置全部正确无误后，<code>HttpSession</code>还是不能同步，这是因为浏览器限制。</p>
<p><code>Chrome</code>与<code>Edgd</code>配置相似，因为同核。其它浏览器有待研究</p>
<ol>
<li>在地址栏输入<code>chrome://flags</code>、<code>edge://flags</code></li>
<li>搜索<code>cookies</code></li>
<li>禁用下列两项<ul>
<li><code>SameSite by default cookies</code> = <code>Disabled</code></li>
<li><code>Cookies without SameSite must be secure</code> = <code>Disabled</code></li>
</ul>
</li>
</ol>
<p>至止，前后端分离跨域请求<code>HttpSession</code>同步实现成功。</p>

    </div>

    
    
    

      <footer class="post-footer">
	  
	  	
		<div class="post-end">
		  
			<div>
    
	<div class="end-flag">

		<span class="line"></span>

		<span class="text">&ensp;本文到此结束&ensp;<i class="fa fa-heart"></i>&ensp;感谢您的阅读&ensp;</span>

		<span class="line"></span>

    </div>
<!--
        <div style="text-align:center;color: #ccc;font-size:14px;">------------&ensp;本文到此结束&ensp;<i class="fa fa-heart"></i>&ensp;感谢您的阅读&ensp;------------</div>		
-->
    
</div>
		  
		</div>
          <div class="post-tags">
              <a href="/tags/develop/" rel="tag"><i class="fa fa-tags"></i> develop</a>
              <a href="/tags/java/" rel="tag"><i class="fa fa-tags"></i> java</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/01/21/JasperReport/" rel="prev" title="JasperReport 全攻略">
      <i class="fa fa-chevron-left"></i> JasperReport 全攻略
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/03/05/WebSocket/" rel="next" title="WebSocket">
      WebSocket <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>

	  	<div class="post-spread"></div>

	<link rel="stylesheet" href="/css/share.min.css" >
	<script src="/js/jquery-1.10.2.min.js"></script>
	<script src="/js/jquery.share.js"></script>
	<script src="/js/jquery.qrcode.min.js"></script>

	<script>
	var statement = "本文取自网络"
	+( $('#quote').data('modify') ? "（已作部分改动及格式整理），":"，")
	+( $('#quote').data('source') ? "原文来自<a id='source_href' href='javascript:getSource()'>这里</a>，":"")
	+"如有侵权请联系<a href='../../../../about/index'>我</a>改正。";
	$('#quote').html(statement);
	function getSource(){
		window.open($('#quote').data('source'))
	}
	</script>
	
	<script>
	var $config = {
	  sites : ['weibo','qq', 'wechat','qzone','douban', 'facebook', 'twitter'],
	  disabled: [ 'linkedin', 'diandian'],
	  wechatQrcodeTitle: "微信扫一扫",
	  wechatQrcodeHelper: '<p>微信扫一扫，右上角分享</p>',
	  source: 'Marvin'
	};


	$('.post-spread').share($config);

	function pjaxshare() {
	  $('.post-spread').share($config);
	}
	</script>	
	  
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
	  
	  <!--网易云音乐播放器-->
	  <iframe
	  frameborder="no" border="0" marginwidth="0" marginheight="0" 
	  width=300 height=450 
	  src="//music.163.com/outchain/player?type=0&id=5442729063&auto=0&height=430">
	  </iframe>

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE"><span class="nav-number">1.</span> <span class="nav-text">后端配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%89%8D%E7%AB%AF%E8%AF%B7%E6%B1%82"><span class="nav-number">2.</span> <span class="nav-text">前端请求</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%8F%E8%A7%88%E5%99%A8%E8%AE%BE%E7%BD%AE"><span class="nav-number">3.</span> <span class="nav-text">浏览器设置</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Marvin"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Marvin</p>
  <div class="site-description" itemprop="description">博闻天地</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">14</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/liu-tm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;liu-tm" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:liumin@liu-tm.cn" title="E-Mail → mailto:liumin@liu-tm.cn" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="http://wpa.qq.com/msgrd?v=3&uin=352626862&site=qq&menu=yes" title="QQ → http:&#x2F;&#x2F;wpa.qq.com&#x2F;msgrd?v&#x3D;3&amp;uin&#x3D;352626862&amp;site&#x3D;qq&amp;menu&#x3D;yes" rel="noopener" target="_blank"><i class="fa fa-user fa-fw"></i>QQ</a>
      </span>
  </div>



      </div>
	  
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  <span>Copyright </span>
  
  &copy; 2020 – 
  <span itemprop="copyrightYear">2021</span>
  
  <!--
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  -->
  
  <span>Author by </span>
  
  <span class="author" itemprop="copyrightHolder">Marvin</span>
</div>
<div>
	<!--
    <span class="post-meta-divider">|</span>
	-->
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">60k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">55 分钟</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : true,
      notify     : true,
      appId      : '3GDAqGOhX31UHhUeEgKgOPrs-gzGzoHsz',
      appKey     : 'c0Q8up8LMo25TzptQjdEJoEW',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
